<template>
    <div class="inputBox">
        <span v-if="label" class="asterisk">*</span>
        <!-- {{ label }}
        {{ placeholder }}
        {{ value }} -->
        <span v-if="label" class="label"> {{ label }}</span>
        <input
            style="width: 100%"
            class="inputText"
            :placeholder="placeholder"
            @input="(e) => onInput(e, paramsValue)"
           
        />
    </div>
</template>
<script setup lang="ts">
import { defineProps, withDefaults } from 'vue'

interface Props {
    value?: string
    onInput?: Function
    placeholder: string
    label?: string
    paramsValue?: string
    width?: number
}
withDefaults(defineProps<Props>(), {
    value: '',
    onInput: () => {},
    placeholder: '请输入手机号',
    label: '',
    paramsValue: '',
    width: 200
})
</script>
<style scoped lang="scss">
.inputBox {
    display: flex;
    height: 38px;
    // width:300px;
    // background: red;
    align-items: center;
    .asterisk {
        height: 100%;
        display: inline-block;
        line-height: 38px;
        width: 10px;

        color: red;
    }
    .label {
        font-size: 12px;
        width: 80px;
        margin-right: 10px;
    }
    .inputText {
        height: 38px;
      
        font-size: 12px;
    }
}
</style>
